package com.dave.admin.modular.boss.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dave.admin.common.base.BaseEntity;
import com.dave.admin.common.constant.PermissionConstant;
import lombok.Data;

/**
 * <p>
 * 权限表
 * </p>
 *
 * @author Dave

 */
@Data
@TableName("boss_permission")
public class Permission extends BaseEntity implements PermissionConstant {

    private static final long serialVersionUID = 1L;


    /**
     * 权限名称
     */
    private String name;

    /**
     * 父权限
     */
    private String parentId;

    /**
     * 父权限名称:冗余字段
     */
    @TableField(exist = false)
    private String parentName;

    /**
     * 权限值
     */
    private String value;

    /**
     * 权限类型：0->目录；1->菜单；2->按钮（接口绑定权限）
     */
    private Short type;

    /**
     * 排序
     */
    private Integer sort;


    /**
     * 图标
     */
    private String icon;

    /**
     * 备注
     */
    private String description;


    public static final String PARENT_ID = "parent_id";

    public static final String NAME = "name";

    public static final String VALUE = "value";

    public static final String TYPE = "type";


    public static final String DESCRIPTION = "description";

    @Override
    public String toString() {
        return "Permission{" +
                "parentId=" + parentId +
                ", name=" + name +
                ", value=" + value +
                ", description=" + description +
                "}";
    }
}
